package org.fyp.synchrona.util;

import java.util.LinkedList;
import java.util.Queue;

public class DataQueue {
	
	private static DataQueue qu = null;
	
	private static Queue q ;
	
	private DataQueue(){
				
	}
	
	public static synchronized DataQueue getDataQueueObject(){
		
		if(qu == null){
			
			qu = new DataQueue();
			q = new LinkedList();
			return qu;
			
		}else{
			
			return qu;
			
		}
		
	}
	
	public static void addElement(String element){	
		
		qu.getQueue().add(element);
		
	}
	
	public static Queue getQueue(){
		
		return q;
		
	}
	
	public static int getQueueSize(){
		
		return qu.getQueue().size();
		
	}

}
